package com.hackordie.operations.updates;

import com.hackordie.commons.HackOrDieResult;
import com.hackordie.commons.hardware.computer.ComputerType;
import com.hackordie.exceptions.HackOrDieException;
import com.hackordie.operations.AHackOrDieOperationComputerType;

public class UpdateComputerType extends AHackOrDieOperationComputerType{

	private ComputerType computerType;
	
	public UpdateComputerType(ComputerType computerType) {
		super();
		this.computerType = computerType;
	}

	@Override
	protected boolean checkParameters() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	protected HackOrDieResult executeOperation() throws HackOrDieException {
		result.setCorrect(computerTypeDao.update(computerType));
		result.setObject(computerType);  //TODO quisas no aga falta este, los de los demas execute de components
		return result;
	}

}
